// 获取ext配置
const getExtConfig = () => {
    const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : false;
    console.log(extConfig);

    if (!extConfig) {
        uni.showModal({
            title: "提示",
            content: "当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。"
        });
        return false;
    }
    if (extConfig && Object.keys(extConfig).length === 0) {
        console.log('Error: extConfig is required');
    }

    return extConfig
}

// 商户信息
const extConfig = getExtConfig();

export const baseTenantid = extConfig.shopInfo.tenantId;

export const baseShopId = extConfig.shopInfo.shopId;  //店铺id

export const testApiUri = 'http://192.168.103.62:17100/';  //测试的请求地址

export const baseApiUri = extConfig.shopInfo.baseApiUri; //请求地址

export const templateFileUri = extConfig.shopInfo.templateFileUri;  //静态资源地址

export const baseTemplateData = extConfig.templateData;  //颜色配置

export const baseFileUri = ''; // 暂由后端直接拼接服务器地址

export const socketUrl = `wss://${extConfig.shopInfo.baseApiUri.replace(/(http:\/\/)|(https:\/\/)/g,"")}`;  //webSocket地址 